package com.example.toolproject.demo.service.serviceimpl;

import com.example.toolproject.demo.domain.ScenicSport;
import com.example.toolproject.demo.mapper.ScenicSportMapper;
import com.example.toolproject.demo.service.ScenicSportService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * @ClassName ScenicSportServiceImpl
 * @Description TODO
 * @Author lvyongwei
 * @Date 2020-06-19 17:52
 **/
@Service
public class ScenicSportServiceImpl implements ScenicSportService {

    @Autowired
    private ScenicSportMapper scenicSportMapper;


    /**
     * 根据景区id获取景点信息
     * @Param id 景区id
     * @Param userId  用户id
     * @return
     */
    @Override
    public List<ScenicSport> getAllScenicSport(int id,int userId) {
        return scenicSportMapper.getAllScenicSport(id,userId);
    }

    /**
     * 根据用户id获取到所选择的所有景点信息
     * @param userId
     * @return
     */
    @Override
    public List<String> getAllScenicSportId(int userId) {
        return scenicSportMapper.getAllScenicSportId(userId);
    }

    /**
     * 根据所选择的景点id获取景点信息
     * @param ids
     * @return
     */
    @Override
    public List<ScenicSport> getChoiceScenicSport(String[] ids) {
        return scenicSportMapper.getChoiceScenicSport(ids);
    }

    /**
     * 根据输入模糊查询 已选择的景点信息
     * @param ids
     * @param message
     * @return
     */
    @Override
    public List<ScenicSport> getScenicSportByMessage(String message) {
        return scenicSportMapper.getScenicSportByMessage(message);
    }

    /**
     * 进行景区的添加
     * @param scenicSport
     * @return
     */
    @Override
    public boolean insertScenicSport(ScenicSport scenicSport) {
        return scenicSportMapper.insertScenicSport(scenicSport);
    }

    /**
     * 获取所有景点信息
     * @return
     */
    @Override
    public List<ScenicSport> getAllScenicSport2() {
        return scenicSportMapper.getAllScenicSport2();
    }

    /**
     * 获取城市数量
     */
    @Override
    public List<Map<String, Object>> getCityCount() {
        return scenicSportMapper.getCityCount();
    }

    /**
     * 获取爬取的城市的5A级景区的销售量
     * @return
     */
    @Override
    public List<Map<String, Object>> getTouristCount() {
        return scenicSportMapper.getTouristCount();
    }

    /**
     * 根据城市名查询所包含的景点信息
     */
    @Override
    public List<ScenicSport> getAllScenicSportByCityName(String scenicCountry) {
        return scenicSportMapper.getAllScenicSportByCityName(scenicCountry);
    }

    /**
     * 获取最后爬取的内容时间
     * @return
     */
    @Override
    public String getNewDate() {
        return scenicSportMapper.getNewDate();
    }
}
